import request from '@/utils/request'

export default {
  tree() {
    return request({
      url: '/system/menu/tree',
      method: 'get'
    });
  },
  menuTree() {
    return request({
      url: '/system/menu/menuTree',
      method: 'get'
    });
  },
  roleMenuTree(roleId) {
    return request({
      url: '/system/menu/roleMenutree/' + roleId,
      method: 'get'
    });
  },
  getMenuById(roleId) {
    return request({
      url: '/system/menu/get/' + roleId,
      method: 'get'
    });
  },
  addMenu(menu) {
    return request({
      url: '/system/menu/add',
      method: 'post',
      data: menu
    })
  },
  updateMenu(menu) {
    return request({
      url: '/system/menu/update',
      method: 'put',
      data: menu
    })
  },
  removeById(menuId) {
    return request({
      url: '/system/menu/remove/' + menuId,
      method: 'delete'
    });
  },
}